package com.spring.gop.proj.controller;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.SessionAttributes;

import com.spring.gop.proj.interfaces.EventService;
import com.spring.gop.proj.interfaces.MovieService;
import com.spring.gop.proj.model.Event;
import com.spring.gop.proj.model.MovieAttach;

@Controller
@RequestMapping("/event/*")
@SessionAttributes("event")
public class EventController {

	@Autowired private EventService eventService;
	
	@RequestMapping
	public void list(Model model) {
		model.addAttribute("startList", eventService.selectEvents());
		model.addAttribute("endList", eventService.selectLastEvent());
	}
	
	@RequestMapping(value="/eventdetail", method=RequestMethod.GET)
	public void eventdetail(Model model, int num, HttpSession session) {
		model.addAttribute("event", eventService.selectEvent(num));
	}
	
	
}



















































